<template>
  <view>
    <view class="w100 pt-8 pl-55 pr-55 fs-40 col000 fw-b mb-20" style="text-align: center;">{{data.title}}</view>
    <view class="w100 pl-24 pr-24">
      <rich-text :nodes="data.content"></rich-text>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        content:'',
        id:'',
        data:{}
      };
    },
    onLoad(e) {
      this.id = e.id
      this.getInfo()
    },
    methods:{
      getInfo(){
        this.$tools.axiosFromToken('POST','prozczx/getById',{id:this.id},'加载中').then(res => {
          if(res.code != 200) return this.$tools.showtt(res.msg)
          let {data} = res
          this.data = data
          // this.data.content = this.data.content.replace(/<img/gi,'<img style="max-width:100%"')
          if (typeof this.data.content === 'string') {
            this.data.content = this.data.content.replace(/<img([^>]*)>/gi, '<img$1 style="max-width:100%">');
          }
        })
      }
    }
  }
</script>

<style lang="scss">

</style>
